#!/usr/bin/perl

#Adding and Removing Elements in Array


# Define an array
@coins = ("Quarter","Dime","Nickel");
print "First Statement : @coins";
print "\n";

# Add one element at the end of the array
push(@coins, "Penny");
print "Second Statement : @coins";
print "\n";
# Add one element at the beginning of the array
unshift(@coins, "Dollar");
print "Third Statement : @coins";
print "\n";

# Remove one element from the last of the array.
pop(@coins);
print "Fourth Statement : @coins";
print "\n";
# Remove one element from the beginning of the array.
shift(@coins);
print "Fifth Statement : @coins";
print "@coins";


#Sorting Arrays

# Define an array
@foods = qw(pizza steak chicken burgers);
print "Before sorting: @foods\n";

# Sort this array
@foods = sort(@foods);
print "After sorting: @foods\n";


